package com.project_test.kun.travelling_1st.HomePage.category;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 16-10-17.
 */
public class HomePListItemBanner {

    private int id;
    private String mImg;
    private String title;
    private int type;
    private int item_id;

    public void pashJson(JSONObject json) throws JSONException {
//        "id": "32",
        id = json.getInt("id");
//                "img": "http://img1.handybest.com/Public/Banner/20160622/146659032836248.jpg!phone",
        mImg = json.getString("img");
//                "title": "住在田园别墅里，感受星空下的宁静夏夜",
        title = json.optString("title");
//                "type": "1",
        type = json.optInt("type");
//                "item_id": "131"
        item_id = json.optInt("item_id");
    }

    public int getId() {
        return id;
    }

    public String getImg() {
        return mImg;
    }

    public String getTitle() {
        return title;
    }

    public int getType() {
        return type;
    }

    public int getItem_id() {
        return item_id;
    }

    @Override
    public String toString() {
        return "HomePListItemBanner{" +
                "id=" + id +
                ", mImg='" + mImg + '\'' +
                ", title='" + title + '\'' +
                ", type=" + type +
                ", item_id=" + item_id +
                '}';
    }
}
